Count {Load Case}

Count

Syntax

SapObject.SapModel.LoadCases.Count

VB6 Procedure

Function Count(Optional ByVal CaseType As eLoadCaseType) As Long

Parameters

CaseType

This optional value is one of the following items in the eLoadCaseType enumeration.

CASE_LINEAR_STATIC = 1

CASE_NONLINEAR_STATIC = 2

CASE_MODAL = 3

CASE_RESPONSE_SPECTRUM = 4

CASE_LINEAR_HISTORY = 5 (Modal Time History)

CASE_NONLINEAR_HISTORY = 6 (Modal Time History)

CASE_LINEAR_DYNAMIC = 7 (Direct Integration Time History)

CASE_NONLINEAR_DYNAMIC = 8 (Direct Integration Time History)

CASE_MOVING_LOAD = 9

CASE_BUCKLING = 10

CASE_STEADY_STATE = 11

CASE_POWER_SPECTRAL_DENSITY = 12

CASE_LINEAR_STATIC_MULTISTEP = 13

CASE_HYPERSTATIC = 14

If no value is input for CaseType, a count is returned for all load cases in the model regardless of type.

Remarks

This function returns the total number of defined load cases in the model. If desired, counts can be returned for all load cases of a specified type in the model.

VBA Example

Sub CountLoadCases()

'dimension variables

Dim SapObject as cOAPI

Dim SapModel As cSapModel

Dim ret As Long

Dim Count As Long

'create Sap2000 object

Set SapObject = CreateObject("CSI.SAP2000.API.SapObject")

'start Sap2000 application

SapObject.ApplicationStart

'create SapModel object

Set SapModel = SapObject.SapModel

'initialize model

ret = SapModel.InitializeNewModel

'create model from template

ret = SapModel.File.New2DFrame(PortalFrame, 3, 124, 3, 200)

'return number of load cases of all types

Count = SapModel.LoadCases.Count

'close Sap2000

SapObject.ApplicationExit False

Set SapModel = Nothing

Set SapObject = Nothing

End Sub

Release Notes

Initial release in version 11.00.

Added optional CaseType parameter in version 11.02.

Changed nomenclature from Load Cases, Analysis Cases and Response Combinations to Load Patterns, Load Cases and Load Combinations, respectively, in version 12.00.

Added one item to the eLoadCaseType enumeration in version 12.00.

See Also